import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
// import {LoginComponent} from './login/login.component';
// import {RegisterComponent} from './login/register/register.component';
// import {DashboardComponent} from './dashboard/dashboard.component';
import {authGuard} from './guards/auth.guard';

const routes: Routes = [
  { path: 'login', loadChildren: () => import('./login/login.module').then(m => m.LoginModule) },
  // { path: 'login', component: LoginComponent },
  // { path: 'register', component: RegisterComponent },
  { path: 'dashboard', loadChildren: ()=> import('./dashboard/dashboard.module').then(m => m.DashboardModule), canActivate: [authGuard] },
  { path: 'svg-canvas', loadChildren: () => import('./svg-canvas/svg-canvas.module').then(m => m.SvgCanvasModule) },
  { path: '', redirectTo: 'svg-canvas', pathMatch: 'full' },
  { path: '**', redirectTo: 'login'}
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
